<nav class="navbar navbar-toggleable-md navbar-light site-navigation">
  <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <a class="navbar-brand" href="{{link-to "index"}}">
    <img src="assets/img/icon-dark-flattened.png" width="30" height="30" class="d-inline-block align-top" alt="{{site.name}}">
    {{@site.name}}
  </a>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      {{#if @site.nav.main}}
        {{#pages}}
          {{#each (sort-list items @site.nav.main) as | item |}}
          <li class="nav-item {{#is @root.page.stem item.stem}}active{{/is}}">
            <a class="nav-link" href="{{link-to item.relative}}">{{titleize (default item.data.link item.data.title)}}</a>
          </li>
          {{/each}}
        {{/pages}}
      {{/if}}

      {{> site-nav-dropdown }}
    </ul>

    <ul class="navbar-nav gh-buttons pull-right">
      <li class="nav-item">
        {{> btn-github type="watch"}}
      </li>
      <li class="nav-item">
        {{> btn-github type="fork"}}
      </li>
    </ul>

    {{!> site-search }}
  </div>
</nav>
